package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sc.nft.dto.DrawPrizeDTO;
import com.sc.nft.entity.vo.PledgeTaskRewardVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.PledgeTaskReward;
import com.sc.nft.mapper.PledgeTaskRewardMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 质押任务-奖励列表(sc_pledge_task_reward)数据DAO
 *
 * @author Sun
 * @since 2023-06-12 15:36:43
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class PledgeTaskRewardDao extends ServiceImpl<PledgeTaskRewardMapper, PledgeTaskReward> {

    public List<PledgeTaskReward> getListByPledgeTaskIdAndPledgeTaskCollectionId(Long pledgeTaskId, Long pledgeTaskCollectionId) {
        LambdaQueryWrapper<PledgeTaskReward> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(PledgeTaskReward::getPledgeTaskId, pledgeTaskId);
        wrapper.eq(PledgeTaskReward::getPledgeTaskCollectionId, pledgeTaskCollectionId);
        return list(wrapper);
    }

    public List<PledgeTaskReward> getListByPledgeTaskCollectionIdAndPledgeTaskId(Long pledgeTaskId, Long pledgeTaskCollectionId) {
        return baseMapper.getListByPledgeTaskCollectionIdAndPledgeTaskId(pledgeTaskId, pledgeTaskCollectionId);
    }

    public List<DrawPrizeDTO> getDrawPrizeDTOListByPledgeTaskCollectionIdAndPledgeTaskId(Long pledgeTaskId, Long pledgeTaskCollectionId) {
        return baseMapper.getDrawPrizeDTOListByPledgeTaskCollectionIdAndPledgeTaskId(pledgeTaskId, pledgeTaskCollectionId);
    }
}